package com.chat.datea.fragment;

import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chat.datea.R;
import com.chat.datea.adapter.SearchResultAdapter;
import com.chat.datea.base.BaseFragment;

/**
 * Created by Shura on 15/11/3.
 */
public class SearchResultFragment extends BaseFragment {
    private TabLayout search_result_tabLayout;
    private ViewPager search_result_viewpager;
    private SearchResultAdapter searchResultAdapter;
    private FragmentManager fragmentManager;

    @Override
    protected void initData() {
        search_result_viewpager.setAdapter(searchResultAdapter);
        search_result_tabLayout.setupWithViewPager(search_result_viewpager);
        search_result_tabLayout.setSelectedTabIndicatorColor(0xff0088ff);
    }

    @Override
    protected void initView() {
        searchResultAdapter = new SearchResultAdapter(fragmentManager, getChildFragmentManager());
        search_result_tabLayout = (TabLayout) view.findViewById(R.id.search_result_tabLayout);
        search_result_viewpager = (ViewPager) view.findViewById(R.id.search_result_viewpager);
    }

    @Override
    protected View inflaterView(LayoutInflater inflater, ViewGroup container) {
        view = inflater.inflate(R.layout.search_result_layout, null);
        return view;
    }

}
